# Makefile. 
#
# Use 'make' for general debug version.
# Use 'make release' for release version.
# See below the flags for each target:
#

MPI_COMPILE_FLAGS = $(shell mpiCC --showme:compile)
MPI_LINK_FLAGS = $(shell mpiCC --showme:link) -fopenmp

FLAGS= 
CC=gcc-4.2

all: debug

lol:
	mpicc -fopenmp projFinal.c -g -O3 -o projFinal

clean:
	rm -rf *.o projFinal

debug: FLAGS += -g
release: FLAGS += -s -O3

debug: build
release: build

build: projFinal.o
	$(CC) $(MPI_COMPILE_FLAGS) $(FLAGS) $(MPI_LINK_FLAGS) projFinal.o -o projFinal

projFinal.o: projFinal.c
	$(CC) -c $(MPI_COMPILE_FLAGS) $(FLAGS) $(MPI_LINK_FLAGS) projFinal.c
